#!/bin/bash
docker stop reone/loushi
if [[ $? -eq 0 ]]
then
    echo "stop reone/loushi success"
    docker rmi reone/loushi
    if [[ $? -eq 0 ]]
    then
        echo "delete reone/loushi success"
    else echo "delete reone/loushi faild";fi
else echo "stop reone/loushi faild";fi
mvn clean
if [[ $? -eq 0 ]]
then
    echo "clean reone/loushi success"
    mvn package
    if [[ $? -eq 0 ]]
    then
        echo "package reone/loushi success"
        mvn docker:build
        if [[ $? -eq 0 ]]
        then
            echo "build image reone/loushi success"
        else echo "build image reone/loushi faild";fi
    else echo "package reone/loushi faild";fi
else echo "clean reone/loushi faild";fi
